/**
 * @Author 12629
 * @Description：
 */
class UserNameException extends RuntimeException {

    public UserNameException() {

    }

    public UserNameException(String message) {
        super(message);
    }
}

class PasswordException extends RuntimeException {

    public PasswordException() {

    }


    public PasswordException(String message) {
        super(message);
    }
}

public class LogIn {
    private static final String uName = "admin";
    private static final String pWord = "123456";

    public static void loginInfo(String userName, String password) {
        if (!uName.equals(userName)) {
            throw new UserNameException("用户名错误: "+userName);
        }
        if (!pWord.equals(password)) {
            throw new PasswordException("密码错误: "+password);
        }
        System.out.println("登陆成功");
    }

    public static void main(String[] args) {
        try {
            loginInfo("admin1", "123456");
        } catch (UserNameException e) {
            e.printStackTrace();
        } catch (PasswordException e) {
            e.printStackTrace();
        }
    }
}
